cmake_minimum_required(VERSION 3.4.1)

add_library( # Sets the name of the library.
        native-lib
        SHARED
        native-lib.cpp)

#导入头文件
include_directories(${CMAKE_SOURCE_DIR}/include)

#导入库文件，即libs/armeabi-v7a/下的.so文件，和下面的target_link_libraries结合使用
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/../../../libs/${ANDROID_ABI}")

find_library( # Sets the name of the path variable.
        log-lib
        log)

target_link_libraries( # Specifies the target library.
        native-lib
        #这个命名规范就是去掉前面的lib和后面的.so或则.a
        opencv_java4
        ${log-lib}
        android)